using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UIManager:Singleton<UIManager> 
{
    public Stack<UIBase> uiViewStack = new Stack<UIBase>();
    
    public List<UIBase> uiList = new List<UIBase>();
    public Transform normalUIParent;

    private void Start()
    {
        
    }

    public void OpenUI(UIBase ui)
    {
        ui.OnEnter();
        Debug.LogFormat("OpenUI UI : {0}",ui.uiName);
    }

    public void CloseUI(UIBase ui)
    {
        ui.OnExit();
        Debug.LogFormat("CloseUI UI : {0}",ui.uiName);
    }

    public UIBase GetUI(string uiName)
    {
        foreach (UIBase uiview in uiList)
        {
            if (uiview.uiName == uiName)
            {
                return uiview;
            }
        }
        
        Debug.Log("not ui found");
        return null;
    }
}
